<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/common/topBegin.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/Validform.css"/>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/right_yz.css"/>
 <script type="text/javascript" src="${ctx}/js/jquery-1.7.1.min.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/Validform_v5.3.2.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/right_Validform_v5.3.2_config.js"></script>
 <script type="text/javascript" src="${ctx}/js/ajaxfileupload.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ext-base.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ext-all.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ui/ext-ui.js"></script>
<script type="text/javascript" src="${ctx}/js/public/console.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ux/Toast.js"></script>
<script>
var cfg = {cxt:'${ctx}'};
<c:if test="${not empty entity}">
	<c:set var="url" value="carAttach/update.action"/>
</c:if>
<c:if test="${ empty entity}">
<c:set var="url" value="carAttach/add.action"/>
</c:if>
</script>
</head>
<body>
<div  id="table_form_div" class="table_form1">
<form  action="${ctx}/${url}" method="post" id="formobj" enctype="multipart/form-data">
 <input type="hidden" id="subBtn"   />
 <input type="hidden" id="backTip"  value="操作成功" />
  <table class="table-form" width="100%">
   <tbody>
      <tr>
	       <td width="10%" class="table-th">车辆类型<font color="red">*</font></td>
	       <td class="table-td" width="15%">
	           	<select id="cmb_type" name="type" onchange="carForm.loadCarInfo();">
	           		<option value="1" <c:if test="${empty entity.type||entity.type==1 }">selected="selected"</c:if>>主车</option>
	           		<option value="2" <c:if test="${entity.type==2 }">selected="selected"</c:if>>挂车</option>
	           	</select>
	        </td>
	        <td  width="10%" class="table-th">车牌<font color="red">*</font></td>
           <td class="table-td"  width="25%">
                 <input type="text" class="input-text" name="licenseNum" readonly="readonly" maxlength="7" id="txt_licenseNum"  datatype="*"  value="${car.licenseNum }"/>
                <!--  <input type="button" id="btn_choose" value="选择" onclick="carForm.openGridView();"/> -->
                 <input type="hidden" id="hid_licenseNum" value="${car.licenseNum }"/>
                 <input type="hidden" id="hid_licenseNum2" value="${car.licenseNum2}"/>
           </td>
	       <td  width="10%" class="table-th">附件名称</td>
         　	 　<td class="table-td" width="25%">
	           <input type="text" id="txt_fileName"  class="input-text" value="${entity.fileName }" name="fileName" maxlength="32"  datatype="*" />
	       </td>
	   </tr>
	   <tr>
		  <td  width="10%" class="table-th">
		  	<input type="button" id="btn_upload" value="上传附件" onclick="carForm.openAttachWin();"/>
		  </td>
         <td colspan="5"><div id="attach_div">
         	<c:if test="${not empty entity.filePath}">
         		<c:set var="files" value="${fn:split(entity.filePath,',')}"/>
         		<c:forEach var="item" items="${files }">
         			<c:set var="itemFile" value="${fn:substring(item,(fn:indexOf(item,'/')+1),fn:length(item))}"/>
         			<c:set var="preItemFile" value="${fn:substring(itemFile,0,fn:indexOf(itemFile,'.')) }"/>
        			<span id="sp_${preItemFile}" style="padding-left:8px;padding-right:5px;">${itemFile }</span>
        			<a id="a_${preItemFile}" href="javascript:void(0);" onclick="carForm.delFile('${itemFile}');">删除</a>
        			<input type="hidden" id="hid_${preItemFile}" value="${item }"/>
         		</c:forEach>
         	</c:if>
         </div></td>
		 </tr>
	      
		 </tbody>
	  </table>
	   <input type="hidden" id="id"  name="id" value="${entity.id}" />
	    <input type="file"  id="attachFile" name="file" style="display:none" />
	    <input type="hidden" id="hid_filePath" name="filePath" value="${entity.filePath }"/>
	  </form>
	  </div>
	  <script type="text/javascript" src="${ctx}/js/app-web/biz/carAttach/carAttachForm.js"></script>
	  </body>
	  </html>
	  